var rootview = ui("$");
var do_App = sm("do_App");
var do_Page = sm("do_Page");
var nf = sm("do_Notification");
var do_Global = sm("do_Global");
var http = require("helper/http");
var helperOpen = require("helper/open");
var communityUtil = require("helper/community");
var activityHelper = require("helper/activity");

var activityTitle=ui("activityTitle");
var activityState=ui("activityState");
rootview.setMapping({   // 此处的Mapping只能设置在 RootView 上 ;
	"activityTitle.tag" : "id",
    "activityTitle.text" : "name",
    "activityState.text" : "showStatus",
    "activityPrice.text" : "showCost",
    "activityImg.source" : "pathLogo",
    "activityAddr.text" : "address",
    "InforReply.text" : "replyCount",
});
rootview.on("dataRefreshed", function(){
	if(activityState.text=='已结束'){
		activityState.fontColor="C0C0C0FF";
	}else{
		activityState.fontColor="FF7E00FF";
	}
});
//点击中间图片区
ui("aLayoutImg").on("touch", function(){
	helperOpen.open("source://view/activity/detail/msgBorderView.ui",{id:activityTitle.tag},"","pay_product_back");
});

//点击底部--更多活动
ui("do_ALayout_2").on("touch", function(data){
	helperOpen.open("source://view/activity/list/main.ui",{type:activityHelper.type.COMMUNIty,bizzId:communityUtil.communityVisitId()});
});